
build:
	@[ ! -d build ]; mkdir build
	@cp share/Dockerfile build/
	@go build -o build/ldap_server main.go
	@echo 'You can run `make init-config`'

init-config:
	@[ ! -d etc ] && mkdir etc
	@cp share/application.yml.example etc/application.yml
	@sed -i 's@#.*$$@@' etc/application.yml
	@sed -i 's@[ ]*$$@@' etc/application.yml
	@echo "Before start up. Please modify the etc/application.yml"

startup:
	@cp share/docker-compose.yml ./
	@docker-compose up -d

clean:
	@[ -d build ] && rm -r build

